package com.cskaoyan.controller.admin.comment;

import com.cskaoyan.bean.MarketComment;
import com.cskaoyan.bean.bo.admin.comment.ListBO;
import com.cskaoyan.bean.common.BasePageInfo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.admin.comment.ListforCommentVO;
import com.cskaoyan.service.admin.comment.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mr.Tang
 * @since 2022/09/08 18:11
 */
@RestController
@RequestMapping("admin/comment")
public class CommentController {



    @Autowired
    CommentService commentService;



    /**
     * 商品评论
     * page=1&limit=20&sort=add_time&order=desc
     * @return
     */
     @RequestMapping("list")
    public BaseRespVo listForComment(ListBO listBO) {
     ListforCommentVO listforCommentVO =  commentService.listForComment(listBO);
     return BaseRespVo.ok(listforCommentVO);
     }


    /**
     * 删除评论
     */
    @RequestMapping("delete")
    public BaseRespVo deleteForComment(@RequestBody MarketComment marketComment) {
        commentService.deleteForComment(marketComment);

     return BaseRespVo.ok(null);
    }


}
